<#assign base=request.contextPath />
<!DOCTYPE html>
<div class="row">
	<div class="col-md-12 col-sm-12 col-xs-12">
		<div class="x_panel">
			<div class="x_title">
		        <h2>产品列表 <small></small></h2>
		        <div class="clearfix"></div>
	        </div>
			<div class="x_content">
				<div class="row">
					<div class="col-sm-2">
						<button type="button" class="btn btn-primary" onclick="toAdd();"><i class="fa fa-plus"></i> 新增</button>
					</div>
					<div class="col-sm-10">
						<div class="pull-right">
							
							<label>
								<select id="contentType" name="contentType" class="form-control select2">
									<option value="">请选择</option>
		                        	<option value="1">资讯</option>
		                        	<option value="2">培训</option>
		                        	<option value="1">资讯评论</option>
		                        	<option value="2">培训评论</option>
	                    		</select>
	                    	</label>
							<button type="button" class="btn btn-dark" onclick="selectQuery('');"><i class="fa fa-search"></i> 查询</button>
						</div>
					</div>
				</div>
				<div class="table-responsive">
					<table class="table table-striped jambo_table bulk_action">
						<thead>
							<tr class="headings">
								 <th class="column-title">信息类型</th>
			                    <th class="column-title">举报类型 </th>
			                    <th class="column-title">举报时间 </th>
			                    <th class="column-title">发表用户</th>
			                    <th class="column-title">举报详情 </th>
			                    <th class="column-title">审核状态</th>
			                    <th class="column-title no-link last"><span class="nobr">操作</span></th>
			                </tr>
						</thead>
			            <tbody>
			            	<#list page.content as obj>
			            	<tr class="even pointer">
			                    <td class=" ">
			                    <#if (obj.contentType==1)>资讯</#if>
			                     <#if (obj.contentType==2)>培训</#if>
			                      <#if (obj.contentType==3)>资讯评论</#if>
			                       <#if (obj.contentType==4)>培训评论</#if>
			                       
			                    </td>
			                     <td class=" ">
			                      <#if (obj.reportType==1)>涉及暴力色情</#if>
			                       <#if (obj.reportType==2)>违法违禁</#if>
			                        <#if (obj.reportType==3)>涉及赌博</#if>
			                         <#if (obj.reportType==4)>不良信息</#if>
			                          <#if (obj.reportType==5)>人身攻击</#if>
			                           <#if (obj.reportType==6)>版权转载问题</#if>
			                            <#if (obj.reportType==7)>其他问题</#if>
			                     </td>
			                    <td class=" ">${(obj.reportTime)!''} </td>
			                     <td class=" ">${(obj.user.userName)!''} </td>
			                      <td class=" ">${(obj.reportContents)!''} </td>
			                    <td class=" ">
			                    	<#if (obj.isCheck==0)>未审核</#if>
			                    	<#if (obj.isCheck==1)><span style="color:red;">已通过</span></#if>
			                    </td>
			               
			                    <td class="last">
			                    <#if (obj.isCheck==0)>
			                    	<button type="button" class="btn btn-warning btn-xs" onclick="toEdit(${(obj.id)?c});"><i class="fa fa-edit"></i> 审核</button>
			                   </#if>
			                    </td>
			                </tr>
			                </#list>
			            </tbody>
					</table>
				</div>
			</div>
			<#include "../common/paginator.ftl" />
		</div>
	</div>
</div>
<script type="text/javascript">
//select2
$(".select2").select2({width: "100px"});
/*进入添加*/
function toAdd(){
	$("#main_content").load('${base}/gx/sysReport/toAdd');	
}

/*进入编辑*/
function toEdit(id){
	$("#main_content").load('${base}/gx/sysReport/toEdit',{"id":id});	
}

/*删除*/
function doDelete(id){
	 swal({
		title: "删除",
		text: "您确定删除该资讯吗？",
		type: "warning",
		cancelButtonText:"取消",
		showCancelButton: true,
		confirmButtonColor: "#DD6B55",
		confirmButtonText: "确定",
		closeOnConfirm: false
	}, function(){
		$.post('${base}/gx/sysReport/delete',{"id":id},function(data) {
			swal(data.msg);
			if (data.flag) {
				$("#main_content").load('${base}/gx/sysReport/list');
			}
		});
	});
}

/*恢复*/
function doRecovery(id){
	 swal({
		title: "恢复",
		text: "您确定恢复该资讯吗？",
		type: "warning",
		cancelButtonText:"取消",
		showCancelButton: true,
		confirmButtonColor: "#DD6B55",
		confirmButtonText: "确定",
		closeOnConfirm: false
	}, function(){
		$.post('${base}/gx/sysReport/recovery',{"id":id},function(data) {
			swal(data.msg);
			if (data.flag) {
				$("#main_content").load('${base}/gx/sysReport/list');
			}
		});
	});
}

function selectQuery(pageIndex){
	var data = {
		"pageIndex":pageIndex,
		//其余查询条件自行添加
		"contentType":$.trim($("#contentType").val()),
	
	};
	$("#main_content").load('${base}/gx/sysReport/list',data);	
}
</script>
